<div class="left">
    <div class='title-page'>Edit Profile</div>
    <div class="form-edit-profile">
	<?php
	$form = $this->beginWidget('CActiveForm', array(
	    "htmlOptions" => array("enctype" => "multipart/form-data")));
	?>

	<?php
	if ($form->errorSummary($modelUser)) {
	    echo '<div class="alert alert-error">' . $form->errorSummary($modelUser) . '</div>';
	}
	?>
	<?php
	if ($error) {
	    echo '<div class="alert alert-error">' . $error . '</div>';
	}
	?>
	<div class='row-edit-profile'>
	    <?php echo $form->label($modelUser, 'first_name'); ?>
	    <?php echo $form->textField($modelUser, 'first_name') ?>
	</div>

	<div class='row-edit-profile'>
	    <?php echo $form->label($modelUser, 'last_name'); ?>
	    <?php echo $form->textField($modelUser, 'last_name') ?>
	</div>

	<div class='row-edit-profile'>
	    <?php echo $form->label($modelUser, 'email'); ?>
	    <?php echo $form->textField($modelUser, 'email') ?>
	</div>


	<div class='row-edit-profile row-avatar'>
	    <label>Current Avatar</label>		
	    <div class="current-avatar">		
		<img src="<?php echo $modelUser->getAvatarUrl() ?>"/>

	    </div>
	    <br/>
	    <label>Choose New avatar</label>
	    <input type='file' name='avatar' accept="image/*"/>
	</div>
	<div class='row-edit-profile'>
	    <label>Birthday:</label>
	    <?php
	    $day = date('d', strtotime($modelUser->birthdate));
	    $month = date('m', strtotime($modelUser->birthdate));
	    $yearBirth = date('Y', strtotime($modelUser->birthdate));
	    ?>

	    Month:
	    <select name="User[month]" class="short-select-sign-up">
		<?php
		for ($i = 1; $i <= 12; $i++) {
		    if ($month == $i) {
			echo "<option value='" . $i . "' selected>" . $i . "</option>";
		    } else {
			echo "<option value='" . $i . "'>" . $i . "</option>";
		    }
		}
		?>
	    </select>

	    Day:
	    <select name="User[day]" class="short-select-sign-up">
		<?php
		for ($i = 1; $i <= 30; $i++) {
		    if ($day == $i) {
			echo "<option value='" . $i . "' selected>" . $i . "</option>";
		    } else {
			echo "<option value='" . $i . "'>" . $i . "</option>";
		    }
		}
		?>
	    </select>

	    Year:
	    <select name="User[year]" class="year-select-sign-up">
		<?php
		$year = date('Y', time());
		for ($i = 0; $i <= 50; $i++) {
		    $j = $year - $i;
		    if ($yearBirth == $j) {
			echo "<option value='" . $j . "' selected>" . $j . "</option>";
		    } else {
			echo "<option value='" . $j . "'>" . $j . "</option>";
		    }
		}
		?>
	    </select>	
	</div>

	<div class='row-edit-profile row-avatar'>
	    <label>Gender:</label>
	    <?php
	    echo $form->dropDownList($modelUser, 'gender', User::getGenderRange(), array('class' => 'edit-select-gender'))
	    ?>
	</div>
	<div class='row-edit-profile row-avatar'>
	    <label>Country:</label>
	    <?php echo $form->dropDownList($modelUser, 'country', Country::getSelectList()) ?>
	</div>
	<div class='row-edit-profile row-avatar'>
	    <label>Zip Code:</label>
	    <?php echo $form->textField($modelUser, 'postcode'); ?>
	</div>	
	<?php
	/*
	  <div class='row-edit-profile row-avatar'>
	  <label>Address:</label>
	  <table id='address-wrapper'>
	  <tr>
	  <td>Street:</td>
	  <td><?php echo $form->textField($modelUser, 'address'); ?></td>
	  </tr>
	  <tr>
	  <td>City/Town:</td>
	  <td><?php echo $form->textField($modelUser, 'city'); ?></td>
	  </tr>
	  <tr>
	  <td>Country:</td>
	  <td><?php echo $form->dropDownList($modelUser, 'country', Country::getSelectList()) ?></td>
	  </tr>
	  <tr>
	  <td>Zip:</td>
	  <td><?php echo $form->textField($modelUser, 'postcode'); ?>	   </td>
	  </tr>
	  </table>
	  </div>


	  <div class='row-edit-profile row-avatar'>
	  <label>Telephone:</label>
	  <?php echo $form->textField($modelUser, 'telephone'); ?>
	  </div>

	  <div class='row-edit-profile row-avatar'>
	  <label>Mobile phone:</label>
	  <?php echo $form->textField($modelUser, 'mobile'); ?>
	  </div>
	  <br>
	 */
	?>



	<div class='edit-pass row-edit-profile'>
	    <label>Old password</label>
	    <input name='oldPassword' type="password"/>
	    <label>New password</label>
	    <?php echo $form->passwordField($modelUser, 'password'); ?>
	    <label>Repeat password</label>
	    <?php echo $form->passwordField($modelUser, 'repassword'); ?>
	</div>

	<div class="clear"></div>

	<div class='save-profile-btn'><input type='submit' value='Save' name='save' class='btn btn-info btn-large'/></div>
	<?php $this->endWidget(); ?>
    </div>
</div>
<div class="right">  
    <div class="box-right">
	<?php $this->widget('application.widgets.loginbox.LoginBox'); ?>

    </div><!--box-right-->
    <?php $this->widget('application.widgets.ad.Ad') ?>
</div><!--right-->